﻿<Window
    x:Class="CrateMayhem.Desktop.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:views="clr-namespace:CrateMayhem.Desktop" 
    xmlns:ctrl="clr-namespace:CrateMayhem.Desktop.Controls"
    mc:Ignorable="d"
    WindowState="Maximized">
    <Grid
        Background="{StaticResource BackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
        <TextBlock 
            Grid.Row="0" 
            Style="{StaticResource GameTextBlockStyle}"
            FontSize="30" 
            Text="Crate Mayhem" 
            HorizontalAlignment="Center" 
            VerticalAlignment="Center"/>
        <StackPanel Name="Layout" Grid.Row="1" Orientation="Horizontal">
            <StackPanel
                Width="300"
                Orientation="Vertical">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Row="0" Grid.Column="0" Text="Level:" Style="{StaticResource GameTextBlockStyle}"/>
                    <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Level}" Style="{StaticResource GameTextBlockStyle}"/>
                    <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding TotalMoves}" Style="{StaticResource GameTextBlockStyle}" Foreground="Gray"/>
                    <TextBlock Grid.Row="1" Grid.Column="0" Text="Moves:" Style="{StaticResource GameTextBlockStyle}"/>
                    <TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding Moves}" Style="{StaticResource GameTextBlockStyle}"/>
                </Grid>
                <views:GameControls Width="250" Margin="0,50,0,0"/>
                <Button 
                    Style="{StaticResource MoveButtonStyle}" 
                    Width="150" 
                    Height="50"
                    Content="Reset to level 1"
                    Command="{Binding ResetLevelCommand}"/>
            </StackPanel>
            <ctrl:GameGrid 
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Level="{Binding Level}"/>
        </StackPanel>
    </Grid>
</Window>
